<template>
	<view class="p10">
		<view class="" v-if="type == 0" v-html="content">
			
		</view>
		<view class="" v-else>
			<view class="" >
				<view class="flex1 newDetail_head">
					<view class="">
						<image class="ml-30" src='../../static/chip/back.png' mode="widthFix" style="width: 30rpx;" @click="backmarket()"></image>
					</view>
					<view class="fw size-22 newDetail">
						{{title}}
					</view>
				</view>
				<view class="center fw">
					{{title}}
				</view>
				<view class="flex1 mt-20" style="border-bottom: 2px solid #E5E5E5;padding: 0px 0px 30rpx 0;">
					<view class="">
						<image :src='image' mode="widthFix" style="width: 60px;"></image>
					</view>
					<view class="mt-30 size-22 ml-20 " style="height: 70rpx;">
						{{create_time}} 
					</view>
				</view>
				<view class="center size-28 fw mt-20" >
					{{desc}}
				</view>
				<view class="size-22 mt-20" style="overflow: hidden;">
					<u-parse :content="content" @preview="preview" @navigate="navigate"></u-parse>
				</view>
			</view>
		</view>
	</view>

	</view>
</template>
<script>
	import uParse from '@/components/u-parse/u-parse.vue'
	export default {
		components: {
			uParse
		},
		data() {
			return {
				image: '',
				title: '',
				create_time: '',
				desc: "",
				content: '',
				type: ''
			}
		},
		onLoad(id) {
			this.id = id.id
			this.type = id.type
			console.log(this.type)
			if(this.type==0){
				this.$http('api/integral_shop/index', {
					id: this.id
				}).then(res => {
					console.log('11',res);
					this.content=res
				});
			}else{
				this.$http('api/index/noticeDetail', {
					id: this.id
				}).then(res => {
					console.log(res);
					this.title = res.title
					this.create_time = res.create_time
					this.desc = res.desc
					this.content = res.content
					this.image = res.image
				});
			}
			
		},
		onShow() {
			this.inye()

		},
		methods: {
			inye() {

			},
			backmarket(){
				uni.navigateBack({
					url:'/pages/market/index'
				})
			}
		}
	}
</script>
<style lang="less" scoped>
	.newDetail_head{
		    height: 80rpx;
		    position: fixed;
		    z-index: 1;
		    background-color: #FFFF;
		    width: 100%;
		    top: 0;
		    left: 0;
		    line-height: 80rpx;
	}
	.newDetail {
		width: 220rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		-o-text-overflow: ellipsis;
		margin: 0 auto;
	}
</style>
